﻿using Microsoft.VisualStudio.Text;

namespace Language.Utility
{
    public static class TextBuffer
    {
        public static string ExtractFilename( this ITextBuffer buffer )
        {
            ITextDocument document;
            if ( buffer.Properties.TryGetProperty( typeof( ITextDocument ), out document ) )
            {
                return document.FilePath;
            }

            return null;
        }
    }
}
